﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Hospital.Models
{
    public class DataManager
    {
        private HostleDataContext _datacontext;

        public DataManager(string connectionString)
        {
            _datacontext = new HostleDataContext(connectionString);
        }

        private MemberShipReposite _membershipreposite;
        public MemberShipReposite Membership
        {
            get
            {
                if (_membershipreposite == null)
                    _membershipreposite = new MemberShipReposite();
                return _membershipreposite;
            }
        }

        private MenReposite _menreposite;
        public MenReposite men
        {
            get
            {
                if (_menreposite == null)
                    _menreposite = new MenReposite(_datacontext);
                return _menreposite;
            }
        }

        private DocReposite _docreposite;
        public DocReposite doc
        {
            get
            {
                if (_docreposite == null)
                    _docreposite = new DocReposite(_datacontext);
                return _docreposite;
            }
        }

        private SpravkaReposite _spravkareposite;
        public SpravkaReposite spr
        {
            get
            {
                if (_spravkareposite == null)
                    _spravkareposite = new SpravkaReposite(_datacontext);
                return _spravkareposite;
            }
        }

        private ZaprReposite _zaprreposite;
        public ZaprReposite zap
        {
            get
            {
                if (_zaprreposite == null)
                    _zaprreposite = new ZaprReposite(_datacontext);
                return _zaprreposite;
            }
        }
    }
}